#include "cyclelist.h"
#include <iostream>
using namespace std;

int main()
{
    int total_num;
    cin >> total_num;

    cyclelist newlist;
    for (int i = 1; i <= total_num; i++)
    {
        Node *newnode = new Node;
        newnode->index = i;
        newlist.push(newnode);
    }

    int delete_gap;
    cin >> delete_gap;

    newlist.pop(delete_gap);

    newlist.print();
    return 0;
}